package finalproject.model.items;

/**
 * The abstract class item is used to represent what an item should be in world
 * of zuul It implements Usable to allow every item to be used
 * 
 * @author Nicolas Bighetti
 *
 */
public abstract class Item implements Usable {

	/**
	 * The item's name
	 */
	private String name;

	/**
	 * The item's description
	 */
	private String description;

	/**
	 * The item's weight
	 */
	private int weight;

	/**
	 * Is the item pickable or not
	 */
	private boolean isPickable;

	/**
	 * If the item is a key in the association
	 */
	private boolean isKey;

	/**
	 * If the item is a value in the assocation
	 */
	private boolean isValue;

	/***
	 * the item constructor
	 * 
	 * @param name
	 *            The item's name
	 * @param description
	 *            The item's description
	 * @param weight
	 *            The item's description
	 * @param isPickable
	 *            is te item pickable
	 */
	public Item(String name, String description, int weight, boolean isPickable, boolean isKey, boolean isValue)
	{
		this.name = name;
		this.description = description;
		this.weight = weight;
		this.isPickable = isPickable;
		this.isKey = isKey;
		this.isValue = isValue;
	}

	/**
	 * @return the name
	 */
	public String getName()
	{
		return name;
	}

	/**
	 * @param name
	 *            the name to set
	 */
	public void setName(String name)
	{
		this.name = name;
	}

	/**
	 * @return the description
	 */
	public String getDescription()
	{
		return description;
	}

	/**
	 * @param description
	 *            the description to set
	 */
	public void setDescription(String description)
	{
		this.description = description;
	}

	/**
	 * @return the weight
	 */
	public int getweight()
	{
		return weight;
	}

	/**
	 * @param weight
	 *            the weight to set
	 */
	public void setWeight(int weight)
	{
		this.weight = weight;
	}

	/**
	 * @return the isPickable
	 */
	public boolean isPickable()
	{
		return isPickable;
	}

	/**
	 * @param isPickable
	 *            the isPickable to set
	 */
	public void setPickable(boolean isPickable)
	{
		this.isPickable = isPickable;

	}

	/**
	 * Test if two items have the same name
	 * 
	 * @param item
	 *            the item to test
	 * @return if the two items have the same name
	 */
	public boolean sameName(Item item)
	{
		if (name.equals(item.getName()))
		{
			return true;
		}
		return false;
	}

	/**
	 * @return the isKey
	 */
	public boolean isKey()
	{
		return isKey;
	}

	/**
	 * @param isKey
	 *            the isKey to set
	 */
	public void setKey(boolean isKey)
	{
		this.isKey = isKey;
	}

	/**
	 * @return the isValue
	 */
	public boolean isValue()
	{
		return isValue;
	}

	/**
	 * @param isValue
	 *            the isValue to set
	 */
	public void setValue(boolean isValue)
	{
		this.isValue = isValue;
	}

	/**
	 * @return the weight
	 */
	public int getWeight()
	{
		return weight;
	}

	@Override
	public String toString()
	{
		return name + ": " + description;
	}
}
